import React, { Component } from 'react';
import Child from '@/components/Child/Child'
class Mine extends Component {
    constructor(props) {
        super(props)
        this.state = {
            fmsg: '父组件数据'
        }
    }
    getSmsgFun = (data) => {
        console.log(data);
    }
    render() {
        let { fmsg } = this.state;
        return (
            <div>
                <h2>父组件</h2>
                <p>{fmsg}</p>
                {/* 1.父组件以属性绑定到子组件中 */}
                <Child fmsg={fmsg} sendSmsgEvent={this.getSmsgFun}></Child>

            </div>
        );
    }
}

export default Mine;